package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.exams.PaperPart;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.PaperPartPO;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.PaperPartView;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface PaperPartConverter {
    PaperPartConverter Instance = Mappers.getMapper(PaperPartConverter.class);

    PaperPartPO toPaperPartPO(PaperPart entity);

    PaperPartPO toPaperPartPO(PaperPart entity, @MappingTarget PaperPartPO po);

    PaperPart toPaperPart(PaperPartPO po);

    PaperPart toPaperPartByView(PaperPartView view);
}
